home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Search / all-in-1-internal-site-search.izs next >
Text File  |  2005-07-29  |  3KB  |  108 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>All-in-one Internal Site Search script
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This useful script allows your visitors to search the contents of your site by leveraging the 3 most popular search engines- Google, Yahoo, and MSN. Now your site's search is truly covered!
  7. <!/DESCRIPTION> 
  8.  
  9. <!CATEGORY>javascript search engines<!/CATEGORY>
  10.  
  11. <!SCRIPT>
  12. <!-- START OF SCRIPT -->
  13. <form name="jksearch" action="http://www.google.com/search" method="get" onSubmit="jksitesearch(this)">
  14.  
  15. <p>Search JavaScript Kit:<br />
  16. <input id="hiddenquery" type="hidden" name="q" />
  17. <input name="qfront" type="text" style="width: 200px" value="navigator object" /> <input type="submit" value="Search" /><br />
  18. <div style="font: bold 11px Verdana;">Google:<input name="se" type="radio" checked>  Yahoo:<input name="se" type="radio">  MSN:<input name="se" type="radio">
  19. </div>
  20.  
  21. <script type="text/javascript">
  22.  
  23.  
  24. //Enter domain of site to search.
  25. var domainroot="www.javascriptkit.com"
  26.  
  27. var searchaction=[ //form action for the 3 search engines
  28. "http://www.google.com/search",
  29. "http://search.yahoo.com/search",
  30. "http://search.msn.com/results.aspx"
  31. ]
  32.  
  33. var queryfieldname=["q","p","q"] //name of hidden query form for the 3 search engines
  34.  
  35. function switchaction(cur, index){
  36. cur.form.action=searchaction[index]
  37. document.getElementById("hiddenquery").name=queryfieldname[index]
  38. }
  39.  
  40. function jksitesearch(curobj){
  41. for (i=0; i< document.jksearch.se.length; i++){ //loop through radio to see which is checked
  42. if (document.jksearch.se[i].checked==true)
  43. switchaction(document.jksearch.se[i], i)
  44. }
  45. document.getElementById("hiddenquery").value="site:"+domainroot+" "+curobj.qfront.value
  46. }
  47.  
  48.  
  49. </script>
  50.  
  51. </p>
  52.  
  53. </form>
  54.  
  55.  
  56. <!-- END OF SCRIPT -->
  57. <!/SCRIPT>
  58.  
  59. <!PREVIEW>
  60. <!-- START OF SCRIPT -->
  61. <form name="jksearch" action="http://www.google.com/search" method="get" onSubmit="jksitesearch(this)">
  62.  
  63. <p>Search JavaScript Kit:<br />
  64. <input id="hiddenquery" type="hidden" name="q" />
  65. <input name="qfront" type="text" style="width: 200px" value="navigator object" /> <input type="submit" value="Search" /><br />
  66. <div style="font: bold 11px Verdana;">Google:<input name="se" type="radio" checked>  Yahoo:<input name="se" type="radio">  MSN:<input name="se" type="radio">
  67. </div>
  68.  
  69. <script type="text/javascript">
  70.  
  71.  
  72. //Enter domain of site to search.
  73. var domainroot="www.javascriptkit.com"
  74.  
  75. var searchaction=[ //form action for the 3 search engines
  76. "http://www.google.com/search",
  77. "http://search.yahoo.com/search",
  78. "http://search.msn.com/results.aspx"
  79. ]
  80.  
  81. var queryfieldname=["q","p","q"] //name of hidden query form for the 3 search engines
  82.  
  83. function switchaction(cur, index){
  84. cur.form.action=searchaction[index]
  85. document.getElementById("hiddenquery").name=queryfieldname[index]
  86. }
  87.  
  88. function jksitesearch(curobj){
  89. for (i=0; i< document.jksearch.se.length; i++){ //loop through radio to see which is checked
  90. if (document.jksearch.se[i].checked==true)
  91. switchaction(document.jksearch.se[i], i)
  92. }
  93. document.getElementById("hiddenquery").value="site:"+domainroot+" "+curobj.qfront.value
  94. }
  95.  
  96.  
  97. </script>
  98.  
  99. </p>
  100.  
  101. </form>
  102.  
  103.  
  104.  
  105. <!-- END OF SCRIPT -->
  106. <!/PREVIEW>
  107.  
  108. <!RELATED>NONE<!/RELATED>